home *** CD-ROM | disk | FTP | other *** search
- /*******************************************\
- * file: EndReport.c *
- * version: 0.1ß *
- * XCMD ID 501 *
- * *
- * Closes down the current document and *
- * deallocates the report's memory *
- * *
- * *
- * ----------------------------------------- *
- * By: Donald Koscheka *
- * Date: 30-OCT-89 *
- * © Copyright 1989, Donald Koscheka *
- * All Rights Reserved *
- * *
- * ----------------------------------------- *
- \*******************************************/
-
- #include <MacTypes.h>
- #include <MemoryMgr.h>
- #include <ResourceMgr.h>
- #include <OSUtil.h>
- #include <HyperXCmd.h>
- #include <HyperUtils.h>
- #include <PrintMgr.h>
- #include "ReportUtils.h"
-
-
- pascal void main( paramPtr )
- XCmdBlockPtr paramPtr;
- /**********************************
- *
- *
- **********************************/
- {
- Handle pH;
- pInfoPtr pp;
- short oldRes;
-
- if( pH = GetSystemResource( PAGE_INFO, PAGE_ID ) ){
- pp = (pInfoPtr)*pH;
-
- /*** shut the printing down ***/
- PrClosePage( pp->prPort );
- PrCloseDoc( pp->prPort );
-
- if( (*(pp->prRecHandle))->prJob.bJDocLoop == bSpoolLoop && !PrError() )
- PrPicFile( pp->prRecHandle, NIL, NIL, NIL, &pp->myStRec );
-
- PrClose();
-
- /*** deallocate our memory ***/
- DisposHandle( (Handle)pp->prRecHandle );
-
- TrashHandle( pp->footNote.key1 );
- TrashHandle( pp->footNote.key2 );
- TrashHandle( pp->footNote.key3 );
-
- RemoveSystemResource( pH );
- }
-
- paramPtr->returnValue = NIL;
- }
-